Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: reuse timers instead of time.After in loops #687

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

gammazero
Copy link
Contributor

Reusing a timer repeatedly results in less GC than time.After in each loop iteration.

Closes #122

Reusing a timer repeatedly results in less GC than time.After in each loop iteration.

Closes #122
@gammazero gammazero requested a review from a team as a code owner October 9, 2024 19:57
Copy link

codecov bot commented Oct 9, 2024

Codecov Report

Attention: Patch coverage is 29.41176% with 12 lines in your changes missing coverage. Please review.

Project coverage is 60.34%. Comparing base (ceb514c) to head (ffcef93).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
mfs/repub.go 12.50% 7 Missing ⚠️
bootstrap/bootstrap.go 0.00% 5 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #687      +/-   ##
==========================================
+ Coverage   60.32%   60.34%   +0.01%     
==========================================
  Files         243      243              
  Lines       31004    31018      +14     
==========================================
+ Hits        18704    18717      +13     
- Misses      10635    10637       +2     
+ Partials     1665     1664       -1     
Files with missing lines Coverage Δ
bitswap/network/ipfs_impl.go 75.17% <100.00%> (+0.26%) ⬆️
bootstrap/bootstrap.go 31.94% <0.00%> (-0.61%) ⬇️
mfs/repub.go 75.23% <12.50%> (-5.38%) ⬇️

... and 11 files with indirect coverage changes

@lidel lidel changed the title Reuse timers instead of time.After in loops refactor: reuse timers instead of time.After in loops Oct 11, 2024
@lidel lidel merged commit 7bf89a7 into main Oct 11, 2024
17 checks passed
@lidel lidel deleted the chore/reuse-timers branch October 11, 2024 16:40
gammazero added a commit that referenced this pull request Oct 22, 2024
@gammazero gammazero mentioned this pull request Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ipfs/go-bitswap] Avoid using time.After
3 participants